#ifndef __StarMatrix_SCENE_H__
#define __StarMatrix_SCENE_H__

#include "cocos2d.h"
#include "star.h"

class StarMatrix : public cocos2d::Node
{
public:
	static StarMatrix* create();
    virtual bool init();
	void onTouch(const cocos2d::Point& p);

	Star* getStarByTouch(const cocos2d::Point& p);
	void genSelectedList(Star* s);
	void deleteSelectedList();
	void updateStar(float delta);
	void adjustMatrix();
public: 
	const static int ROW_NUM = 10;
	const static int COL_NUM = 8;

private:

	Star* stars[ROW_NUM][COL_NUM];
	std::deque<Star*> selectedList;
	void initMatrix();
	cocos2d::Point getPositionByIndex(int i, int j);
};

#endif // __HELLOWORLD_SCENE_H__
